<!DOCTYPE html><html lang="zh-CN"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge" /><meta name="renderer" content="webkit" /><meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width" />
<title>maps</title>
<style>html,body {
	width: 100%;
	height: 100%;
	 margin: 0;
 padding: 0;
}
#map {
 height: 100%;
 }
</style>
<script type="text/javascript" src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.1.js"></script>  
</head>

<body>
<div style="text-align: center;">
<input id="lc" class="input-text" type="text" value="" style="width: 80%; padding-top: 10px; padding-bottom: 10px;">
<a style="padding: 10px; background-color: #FFFFFF;" id="go">GO</a></div>
<div id="map"></div>
<script>
function getQueryVariable(variable){
       var query = window.location.search.substring(1);
       var vars = query.split("&");
       for (var i=0;i<vars.length;i++) {
               var pair = vars[i].split("=");
               if(pair[0] == variable){return pair[1];}
       }
       return(false);
}
var lc=getQueryVariable('lc');
if(typeof(lc)!='string'){ var lca=[35,106];
}else{
var lca=lc.split(',')
if(lca.length<2) lca=[35,106];
}
 document.getElementById('lc').value=lca[0]+','+lca[1]
var lang=getQueryVariable('lang');
if(lang=='cht') lang='zh-tw';
if(lang=='zh') lang='zh-cn';
var map;
function initMap() {
 map = new google.maps.Map(document.getElementById('map'), {
  center: new google.maps.LatLng(lca[0],lca[1]),
 zoom: 12,
minZoom:2,
mapTypeId:google.maps.MapTypeId.ROADMAP
 });	
var marker=new google.maps.Marker({
 position:new google.maps.LatLng(lca[0],lca[1]),
animation:google.maps.Animation.BOUNCE,
icon: {
 path: google.maps.SymbolPath.BACKWARD_CLOSED_ARROW,
 strokeColor: "red",
 scale: 3
 },
});
marker.setMap(map);
var infowindow = new google.maps.InfoWindow({
 content:"my"
});
infowindow.open(map,marker);
google.maps.event.addListener(marker,'click',function() {
infowindow.open(map,marker);
});
google.maps.event.addListener(map,'click', function(point) {
 marker.setPosition(point.latLng)
 document.getElementById('lc').value=point.latLng.lat()+','+point.latLng.lng();
}); 
}

 

document.addEventListener('UniAppJSBridgeReady', function() {  
	 document.querySelector('#go').addEventListener('click', function(evt) {
		 uni.redirectTo({  
		                     url: '/pages/chat/index?lc='+document.getElementById('lc').value
		                 });  
		 });
	
   
});  
document.write("<script src=\"https://ditu.google.cn/maps/api/js?language="+ lang +"&key=AIzaSyCO7v-bJFhZZ2jUgCSu9k2zH8ttTUD6xn0&callback=initMap\"><\/script>");


</script>
</body></html>